﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using Meqs.Entity;
using Meqs.Logic.Interface;

namespace Meqs.Logic.Implement
{
    public class TeacherEvalDesLogic : CommonLogic<TeacherEvalDes, int>, ITeacherEvalDesLogic
    {
        #region Implementation of ICommonLogic<TeacherEvalDes, int>

        /// <summary>
        /// 创建对象
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public int Create(TeacherEvalDes entity)
        {
            return CreateObject(entity);
        }

        /// <summary>
        /// 更新对象
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public int Update(TeacherEvalDes entity)
        {
            return UpdateObject(entity);
        }

        /// <summary>
        /// 删除对象
        /// </summary>
        /// <param name="entityId"></param>
        /// <returns></returns>
        public int Delete(int entityId)
        {
            return DeleteObject(entityId);
        }

        /// <summary>
        /// 删除所有对象
        /// </summary>
        /// <returns></returns>
        public int DeleteAll()
        {
            return DeleteAllObject();
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="entityId"></param>
        /// <returns></returns>
        public TeacherEvalDes FindById(int entityId)
        {
            return FindObjectById(entityId);
        }

        /// <summary>
        /// 检索对象数量
        /// </summary>
        /// <returns></returns>
        public int FindCount()
        {
            return FindObjectByCount();
        }

        /// <summary>
        /// 检索对象
        /// </summary>
        public IList<TeacherEvalDes> FindAll()
        {
            return FindAllObject();
        }

        /// <summary>
        /// 检索对象数量
        /// </summary>
        /// <returns></returns>
        public int FindCount(Hashtable table)
        {
            return FindObjectByCount(table);
        }

        /// <summary>
        /// 检索对象
        /// </summary>
        public IList<TeacherEvalDes> FindAll(Hashtable table)
        {
            return FindObject(table);
        }

        #endregion

        public IList<TeacherInfo> GetDestTeacher(Hashtable ht)
        {
            try
            {
                string statementName = "TeacherEvalDes.FindDestTeacher";
                return ExecuteQueryForList<TeacherInfo>(statementName, ht);
            }
            catch (Exception ex)
            {
                throw;
            }
        }
        public IList<TeacherInfo> FindCauseTeacher(Hashtable ht)
        {
            try
            {
                string statementName = "TeacherEvalDes.FindCauseTeacher";
                return ExecuteQueryForList<TeacherInfo>(statementName, ht);
            }
            catch (Exception ex)
            {
                throw;
            }
        }
        public IList<TeacherInfo> FindHeaderTeacher(Hashtable ht)
        {
            try
            {
                string statementName = "TeacherEvalDes.FindHeaderTeacher";
                return ExecuteQueryForList<TeacherInfo>(statementName, ht);
            }
            catch (Exception ex)
            {
                throw;
            }
        }
        
        public IList<TeacherInfo> FindOtherTeacher(Hashtable ht)
        {
            try
            {
                string statementName = "TeacherEvalDes.FindOtherTeacher";
                return ExecuteQueryForList<TeacherInfo>(statementName, ht);
            }
            catch (Exception ex)
            {
                throw;
            }
        }
        public IList<TeacherInfo> FindClassCauseTeachers(Hashtable ht)
        {
            try
            {
                string statementName = "TeacherEvalDes.FindClassCauseTeachers";
                return ExecuteQueryForList<TeacherInfo>(statementName, ht);
            }
            catch (Exception ex)
            {
                throw;
            }
        }
        public int DeleteAllEval(Hashtable ht)
        {
            try
            {
                string statementName = "TeacherEvalDes.DeleteAllEval";
                return ExecuteDelete(statementName, ht);
            }
            catch (Exception ex)
            {
                throw;
            } 
        }



    }
}
